﻿<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>

    <!-- Basic Page Needs
  ================================================== -->
	<meta charset="utf-8">
	<title>三3三博客社区</title>
	<link rel="icon" href="../images/icon.jpg" sizes="32x32">
	<meta name="description" content="">
	<meta name="author" content="">
	
    <!-- Mobile Specific Metas
  ================================================== -->
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <!-- CSS
  ================================================== -->
	<link rel="stylesheet" href="css/zerogrid.css">
	<link rel="stylesheet" href="css/style.css">
	<link rel="stylesheet" href="css/responsiveslides.css" />
	<link rel="stylesheet" href="css/responsive.css">
	
	<!--[if lt IE 8]>
       <div style=' clear: both; text-align:center; position: relative;'>
         <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
           <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
        </a>
      </div>
    <![endif]-->
    <!--[if lt IE 9]>
		<script src="js/html5.js"></script>
		<script src="js/css3-mediaqueries.js"></script>
	<![endif]-->
	<link href='./images/favicon.ico' rel='icon' type='image/x-icon'/>
	
	<script src="js/jquery.min.js"></script>
	<script src="js/responsiveslides.js"></script>
	<script>
    $(function () {
      $("#slider").responsiveSlides({
        auto: true,
        pager: true,
        nav: true,
        speed: 500,
        maxwidth: 960,
        namespace: "centered-btns"
      });
    });
  </script>
    
</head>
<body>
<!--------------Header--------------->
<header> 
	<div class="zerogrid">
		<div class="row">
			<div class="col05">
				<div id="logo"><a href=""><img src="./images/logo.png"/></a></div>
			</div>
			<div class="col06 offset05">
			   <div id='search-box'>
				  <form id='search-form' method='get' target='_top'>
					<input id='search-text' name='q' placeholder='type here' type='text'/>
					<button id='search-button' type="button" onclick="searchNews()"><span>Search</span></button>
				  </form>
				</div>
			</div>
		</div>
	</div>
</header>

<!--------------Navigation--------------->

<nav>
	<ul>
<!--头条、新闻、财经、体育、娱乐、军事、教育、科技、NBA、股票、星座、女性、健康、育儿-->
		<li><a href="#" onclick="alterType(this.innerText)">头条</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">新闻</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">财经</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">体育</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">娱乐</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">军事</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">教育</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">科技</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">NBA</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">股票</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">星座</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">女性</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">健康</a></li>
		<li><a href="#" onclick="alterType(this.innerText)">育儿</a></li>
	</ul>
</nav>

			
<!--------------Content left--------------->
<section id="content">
	<div class="zerogrid">
		<!--轮播图-->
		<div class="row block">
			
<!--			<div class="featured col16">-->
<!--				<div class="rslides_container">-->
<!--					<ul class="rslides" id="slider">-->
<!--						<li><img src="images/1.jpg"/></li>-->
<!--						<li><img src="images/2.jpg"/></li>-->
<!--						<li><img src="images/3.jpg"/></li>-->
<!--						<li><img src="images/4.jpg"/></li>-->
<!--					</ul>-->
<!--				</div>-->
<!--			</div>-->
			<div class="sidebar col05">
				<section>
					<div class="heading">驾照考题</div>
					<div class="content">
						<ul class="list">
							<li><a href="exam/index.html" target="_blank">1.公安部驾照考试题库； 所有试题均每周与不同地区教材、交管局同步，保证题库总是最新的；

								2.考题种类齐全，分类明确； 解析明了；</a></li>
						</ul>
					</div>
				</section>
				<section>
					<div class="heading">Categories</div>
					<div class="content">
						<ul class="list">
							<li><a href="http://www.zerotheme.com">Free Html5 Templates</a></li>
							<li><a href="http://www.zerotheme.com">Free Css3 Templates</a></li>
							<li><a href="http://www.zerotheme.com">Free Responsive Html5 Templates</a></li>
							<li><a href="http://www.zerotheme.com">Free Basic Html5 Templates</a></li>
							<li><a href="http://www.zerotheme.com">Free Layout Html5 Templates</a></li>
						</ul>
					</div>
				</section>
				<section>
					<div class="heading">Links List</div>
					<div class="content">
					<ul class="list">
						<li><a href="#">Free html5 templates</a></li>
						<li><a href="#">Free css3 menus</a></li>
						<li><a href="#">Free responsive html5 themes</a></li>
						<li><a href="#">Free onepage html5 themes</a></li>
						<li><a href="#">Free animated html5 themes</a></li>
					</ul>
					</div>
				</section>
				<section>
					<div class="heading">Popular Post</div>
					<div class="content">
						<section>
							<img src="images/thumb4.jpg"/>
							<h4><a href="#">Sample post with, links, paragraphs and comments</a></h4>
							<p>Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices.</p>
						</section>
						<section>
							<img src="images/thumb5.jpg"/>
							<h4><a href="#">This is Just Going To Be Another Test Post</a></h4>
							<p>Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices.</p>
						</section>
						<section>
							<img src="images/thumb6.jpg"/>
							<h4><a href="#">This Is Going To Be A Decent Length Title With Little Text</a></h4>
							<p>Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices.</p>
						</section>
					</div>
				</section>
			</div>

			<!--------------Content right--------------->
			<div class="main-content col11" id="table">

			</div>
			<div>
				<button type="button"  onclick="flushNews()" style="position: relative;left: 270px;width: 150px;background-color: red" >点击刷新</button>
			</div>
			
		</div>
	</div>
</section>
<!--------------Footer--------------->
<footer>
	<div class="zerogrid">
		<div class="row">
			<section class="col-1-3">
				<div class="heading">About us</div>
				<div class="content">
					Free Basic Html5 Templates created by <a href="http://www.zerotheme.com">Zerotheme</a>. You can use and modify the template for both personal and commercial use. You must keep all copyright information and credit links in the template and associated files.
				</div>
			</section>
			<section class="col-1-3">
				<div class="heading">Categories</div>
				<div class="content">
					<ul>
						<li><a href="http://www.zerotheme.com">Free Html5 Templates</a></li>
						<li><a href="http://www.zerotheme.com">Free Css3 Templates</a></li>
						<li><a href="http://www.zerotheme.com">Free Responsive Html5 Templates</a></li>
						<li><a href="http://www.zerotheme.com">Free Basic Html5 Templates</a></li>
						<li><a href="http://www.zerotheme.com">Free Layout Html5 Templates</a></li>
					</ul>
				</div>
			</section>
			<section class="col-1-3">
				<div class="heading">Featured Post</div>
				<div class="content">
					<table border="0px">
						<tr>
							<td><img src="images/thumb4.jpg"/></td>
							<td><img src="images/thumb5.jpg"/></td>
							<td><img src="images/thumb6.jpg"/></td>
						</tr>
						<tr>
							<td><img src="images/thumb6.jpg"/></td>
							<td><img src="images/thumb5.jpg"/></td>
							<td><img src="images/thumb4.jpg"/></td>
						</tr>
					</table>
				</div>
			</section>
		</div>
	</div>
</footer>


</body>
<script src="js/jquery.min.js"/>
<script src="js/html5.js"/>
<script src="../blog/editormd/lib/codemirror/modes.min.js"/>
<script src="../../assets/js/jquery.min.js"></script>
<script>
	var pageIndex = 0;
	var type = "头条";
	$(function () {
		getNew();
	})

	function getNew() {
		$("#table").empty();
		var data2 = {pageIndex:pageIndex,type:type};
		$.getJSON("/news/getNews",data2,function (data) {
			if (data.data.length == 0 || data.data == null){
				alert("没有更多了。。。")
				return;
			}
			$.each(data.data, function (i,value) {
				if (i>5){
					return;
				}
				let substr = value.content.substr(0,200);
				$("#table").append(
						'<article><div class="heading"><h4><a href="'+value.url+'" target="_blank">'+value.title+'</a></h4><p class="info">'+value.time+'</p></div>' +
						'<div class="content"><img src="'+value.pic+'" style="width: 185px;height: 140px"><p><a href="'+value.url+'" target="_blank" >'+substr+'</a></p></div>' +
						'<div class="footer"><p class="more"><a class="button" target="_blank" href="'+value.url+'">Read more >></a></p></div></article>'
				)
			})
		})
	}

	//搜索新闻
	function searchNews() {
		let data = $("#search-text").val();
		if (data == null){
			getNew();
			return;
		}
		$("#table").empty();
		var data2 = {keyword:data};
		$.getJSON("/news/searchNews",data2,function (data) {
			if (data.data.length == 0 || data.data == null){
				alert("没有更多了。。。")
				return;
			}
			$.each(data.data, function (i,value) {
				let substr = value.content.substr(0,200);
				$("#table").append(
						'<article><div class="heading"><h4><a href="'+value.url+'" target="_blank">'+value.title+'</a></h4><p class="info">'+value.time+'</p></div>' +
						'<div class="content"><img src="'+value.pic+'" style="width: 185px;height: 140px"><p><a href="'+value.url+'" target="_blank" >'+substr+'</a></p></div>' +
						'<div class="footer"><p class="more"><a class="button" target="_blank" href="'+value.url+'">Read more >></a></p></div></article>'
				)
			})
		})
	}

	//获取指定频道时讯
	function alterType(data) {
		type = data;
		pageIndex = 0;
		getNew();
	}

	//点击更新时讯
	function flushNews() {
		pageIndex = GetRandomNum(0,395)
		getNew();
	}

	//获取随机数
	function GetRandomNum(Min,Max)
	{
		var Range = Max - Min;
		var Rand = Math.random();
		return(Min + Math.round(Rand * Range));
	}
</script>

</html>